home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / XPK.filer < prev    next >
Text File  |  1996-09-26  |  2KB  |  102 lines

  1. /* 
  2.  
  3.    $VER: XPK.filer 2.4 (2.4.95)
  4.  
  5.    Author:
  6.     Matthias Scheler (tron@lyssa.owl.de)
  7.  
  8.    Function:
  9.     All selected files and directories in the active directory listview will
  10.     be packed with XPK. If a compression method is supplied it will be used.
  11.     Else a string requester will appear and ask for the method.
  12.  
  13.    History:
  14.     2.4   removed unnecessary ADDRESS 'FilerRexx'
  15.  
  16.    Requires:
  17.     XPK 2.x or newer
  18.     xPack 1.x or newer
  19.  
  20.    Call:
  21.     XPK [METHOD]
  22.  
  23.    Example for "Filer.RC":
  24.     BUTTON ...,...,"Pack","RX XPK"
  25.    or:
  26.     BUTTON ...,...,"Nuke'em","RX XPK NUKE"
  27.  
  28. */
  29.  
  30. PARSE ARG Compressor
  31.  
  32. OPTIONS RESULTS
  33.  
  34. LOCKFILER
  35. IF RESULT="RESULT" THEN EXIT 5
  36. Key=Result
  37.  
  38. PANEL OFF
  39.  
  40. 'STATUS XPK compression'
  41.  
  42. IF Compressor="" THEN
  43.  DO
  44.   'SETSTRING NUKE'
  45.   'GETSTRING Enter XPK compression method:'
  46.  
  47.   IF RESULT="RESULT" THEN
  48.    DO
  49.     PANEL ON
  50.     UNLOCKFILER Key
  51.  
  52.     'STATUS XPK compression aborted'
  53.     EXIT 5
  54.    END
  55.  
  56.   Compressor=RESULT
  57.  END
  58.  
  59. GETSOURCEPATH
  60. IF RESULT="RESULT" THEN
  61.  DO
  62.   PANEL ON
  63.   UNLOCKFILER Key
  64.  
  65.   EXIT 5
  66.  END
  67. SourceDir=RESULT
  68.  
  69. GETNUMENTRIES
  70. Num=RESULT
  71. DO Index=1 TO Num
  72.  GETNAME Index
  73.  Data=RESULT
  74.  Name=SUBSTR(Data,2)
  75.  
  76.  IF RIGHT(SourceDir,1)=":" THEN SourceName=SourceDir||Name
  77.  ELSE SourceName=SourceDir||"/"||Name
  78.  
  79.  IF LEFT(Data,1)="f" THEN
  80.   DO
  81.    'EXEC xPack "'||SourceName||'" METHOD' Compressor 'ALL'
  82.    TOGGLEENTRY Index
  83.  
  84.    'HISTORY "'||SourceName||'" compressed with method "'||Compressor||'".'
  85.   END
  86.  
  87.  IF LEFT(Data,1)="d" THEN
  88.   DO
  89.    'EXEC xPack "'||SourceName||'" METHOD' Compressor 'ALL'
  90.    TOGGLEENTRY Index
  91.  
  92.    'HISTORY Files in directory "'||SourceName||'" compressed with method "'||Compressor||'".'
  93.   END
  94. END
  95. UPDATESOURCEDIR
  96.  
  97.  
  98. 'STATUS Operation finished !' 
  99.  
  100. PANEL ON
  101. UNLOCKFILER Key
  102.